status: Don't crash if we deployed a local refspec
authorColin Walters <walters@verbum.org>
Tue, 21 Apr 2015 01:02:25 +0000 (21:02 -0400)
committerColin Walters <walters@verbum.org>
Tue, 21 Apr 2015 01:02:25 +0000 (21:02 -0400)
In the case we built a local tree, we'd pass `NULL` as a remote down
to the GPG checking code.  Noticed this in the test suite.

src/ostree/ot-admin-builtin-status.c

index c6597ab3ed7e645609721e344165fad3e3329c30..802aaa8ec257f40f814f0fe899bd89defbc8b9e5 100644 (file)
@@ -74,7 +74,8 @@ deployment_get_gpg_verify (OstreeDeployment *deployment,
   if (!ostree_parse_refspec (refspec, &remote, NULL, NULL))
     goto out;
 
-  (void) ostree_repo_remote_get_gpg_verify (repo, remote, &gpg_verify, NULL);
+  if (remote)
+    (void) ostree_repo_remote_get_gpg_verify (repo, remote, &gpg_verify, NULL);
 
 out:
   return gpg_verify;